package com.zy.ems.common.enums;

/**
 * 商品销售状态-上下架状态 0下架 1上架 2即将到货
 * <P>
 * File name : ProducSellStatus.java
 * </P>
 * <P>
 * Author : hanweiwang
 * </P>
 * <P>
 * Date : 2015年9月15日
 * </P>
 */
public enum ProductSellStatus {
    //
    DOWN(0, "下架"),
    //
    ON(1, "上架"),
    //
    COMMING(2, "即将到货");

    private int index;

    private String title;

    private ProductSellStatus(int index, String title) {
        this.index = index;
        this.title = title;
    }

    public static String getTitle(int index) {
        for (ProductSellStatus j : ProductSellStatus.values()) {
            if (j.getIndex() == index) {
                return j.getTitle();
            }
        }
        return "";
    }

    public int getIndex() {
        return index;
    }

    public String getTitle() {
        return title;
    }
}
